package org.example.socket;

import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.net.Inet4Address;
import java.net.InetSocketAddress;
import java.net.Socket;

public class QQ {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket();
        socket.connect(new InetSocketAddress("127.0.0.1",8888));
        OutputStream outputStream = socket.getOutputStream();
        String msg = "hello server";
        PrintStream printStream = new PrintStream(outputStream);
        printStream.print(msg);
        outputStream.close();
    }
}
